﻿@using System.Data
@using CMSMVC4.Filters
@using CMSMVC4.MultiResource
@model System.Data.DataTable
@{Html.RenderAction("GetBanertop", "Menu", new { type = BanerType.TinTuc });}
<div id="main_mid">
    <div id="dichvu_mid_left">
        @{Html.RenderAction("ListTinTuc", "TinTuc");}
        @{Html.RenderAction("ListContact", "LienHe");}
        @{Html.RenderAction("ListNewsHot", "TinTuc");}
        @{Html.RenderAction("GetBanerleft", "Menu", new { type = BanerType.TinTuc });}
    </div>
    <div id="dichvu_mid_right">
        <div id="tintuc">
            @if (ViewBag.timkiem != null)
            {
                var timkiem = ViewBag.timkiem as DataTable;
                <div id="loadtintuc">
                    <div id="tintuc_tinkhac">
                        <div id="timkiem_title">
                            <img src="/Images/Css/img/iconTimkiem.png" width="50" height="52" alt="search" />
                            <label>
                                KẾT QUẢ TÌM ĐƯỢC CÓ @ViewBag.count KẾT QUẢ CÓ TỪ KHOÁ</label>
                            <label style="color: #F03">
                                "@ViewBag.Model.id"</label></div>
                        @for (int i = 0; i < timkiem.Rows.Count; i++)
                        {
                            if (timkiem.Rows[i]["Type"].ToString().Equals(MenuType.GioiThieu.ToString()))
                            {
                            <div class="tintuc_tinkhac_bantin">
                                <div class="tintuc_tinkhac_bantin_anhbia">
                                    <a href="@Url.Action("Index", "GioiThieu")">
                                        <img src="@Html.Action("GetImg","TimKiem",new{type = MenuType.GioiThieu})" width="213" height="118" boder="0" /></a></div>
                                <div class="tintuc_tinkhac_bantin_data">
                                    <div class="tintuc_tinkhac_bantin_data_title">
                                        <a href="@Url.Action("Index", "GioiThieu")">
                                            @timkiem.Rows[i]["Name"].ToString()
                                        </a>
                                    </div>
                                    <div class="tintuc_tinkhac_bantin_data_conten">
                                        @*@Html.Raw(timkiem.Rows[i]["Summary"].ToString())*@
                                    </div>
                                </div>
                            </div>
                            }
                            if (timkiem.Rows[i]["Type"].ToString().Equals(MenuType.ThiteBi.ToString()))
                            {
                            <div class="tintuc_tinkhac_bantin">
                                <div class="tintuc_tinkhac_bantin_anhbia">
                                    <a href="@Url.Action("Index", "ThietBi", new { id = @timkiem.Rows[i]["Id"].ToString() })">
                                        <img src="@Html.Action("GetImg", "TimKiem", new { type = MenuType.ThiteBi })" width="213" height="118" boder="0" /></a></div>
                                <div class="tintuc_tinkhac_bantin_data">
                                    <div class="tintuc_tinkhac_bantin_data_title">
                                        <a href="@Url.Action("Index", "ThietBi", new { id = @timkiem.Rows[i]["Id"].ToString() })">
                                            @timkiem.Rows[i]["Name"].ToString()
                                        </a>
                                    </div>
                                    <div class="tintuc_tinkhac_bantin_data_conten">
                                        @*@Html.Raw(timkiem.Rows[i]["Summary"].ToString())*@
                                    </div>
                                </div>
                            </div>
                            }
                            if (timkiem.Rows[i]["Type"].ToString().Equals(MenuType.DichVu.ToString()))
                            {
                            <div class="tintuc_tinkhac_bantin">
                                <div class="tintuc_tinkhac_bantin_anhbia">
                                    <a href="@Url.Action("Index", "DichVu", new { id = @timkiem.Rows[i]["Id"].ToString() })">
                                        <img src="@Html.Action("GetImg", "TimKiem", new { type = MenuType.DichVu })" width="213" height="118" boder="0" /></a></div>
                                <div class="tintuc_tinkhac_bantin_data">
                                    <div class="tintuc_tinkhac_bantin_data_title">
                                        <a href="@Url.Action("Index", "DichVu", new { id = @timkiem.Rows[i]["Id"].ToString() })">
                                            @timkiem.Rows[i]["Name"].ToString()
                                        </a>
                                    </div>
                                    <div class="tintuc_tinkhac_bantin_data_conten">
                                        @*@Html.Raw(timkiem.Rows[i]["Summary"].ToString())*@
                                    </div>
                                </div>
                            </div>
                            }
                            if (timkiem.Rows[i]["Type"].ToString().Equals(MenuType.LienHe.ToString()))
                            {
                            <div class="tintuc_tinkhac_bantin">
                                <div class="tintuc_tinkhac_bantin_anhbia">
                                    <a href="@Url.Action("Index", "LienHe", new { id = @timkiem.Rows[i]["Id"].ToString() })">
                                        <img src="@Html.Action("GetImg", "TimKiem", new { type = MenuType.LienHe })" width="213" height="118" boder="0" /></a></div>
                                <div class="tintuc_tinkhac_bantin_data">
                                    <div class="tintuc_tinkhac_bantin_data_title">
                                        <a href="@Url.Action("Index", "LienHe", new { id = @timkiem.Rows[i]["Id"].ToString() })">
                                            @timkiem.Rows[i]["Name"].ToString()
                                        </a>
                                    </div>
                                    <div class="tintuc_tinkhac_bantin_data_conten">
                                        @*@Html.Raw(timkiem.Rows[i]["Summary"].ToString())*@
                                    </div>
                                </div>
                            </div>
                            }
                            if (timkiem.Rows[i]["Type"].ToString().Equals(MenuType.DoiTac.ToString()))
                            {
                            <div class="tintuc_tinkhac_bantin">
                                <div class="tintuc_tinkhac_bantin_anhbia">
                                    <a href="@Url.Action("Index", "DoiTac", new { id = @timkiem.Rows[i]["Id"].ToString() })">
                                        <img src="@Html.Action("GetImg", "TimKiem", new { type = MenuType.DoiTac })" width="213" height="118" boder="0" /></a></div>
                                <div class="tintuc_tinkhac_bantin_data">
                                    <div class="tintuc_tinkhac_bantin_data_title">
                                        <a href="@Url.Action("Index", "DoiTac", new { id = @timkiem.Rows[i]["Id"].ToString() })">
                                            @timkiem.Rows[i]["Name"].ToString()
                                        </a>
                                    </div>
                                    <div class="tintuc_tinkhac_bantin_data_conten">
                                        @*@Html.Raw(timkiem.Rows[i]["Summary"].ToString())*@
                                    </div>
                                </div>
                            </div>
                            }
                            if (timkiem.Rows[i]["Type"].ToString().Equals(MenuType.TinTuc.ToString()))
                            {
                                <div class="tintuc_tinkhac_bantin">
                                <div class="tintuc_tinkhac_bantin_anhbia">
                                    <a href="@Url.Action("BaiViet", "TinTuc", new { id = @timkiem.Rows[i]["Id"].ToString() })">
                                        <img src="@timkiem.Rows[i]["Img"].ToString()" width="213" height="118" boder="0" /></a></div>
                                <div class="tintuc_tinkhac_bantin_data">
                                    <div class="tintuc_tinkhac_bantin_data_title">
                                        <a href="@Url.Action("BaiViet", "TinTuc", new { id = @timkiem.Rows[i]["Id"].ToString() })">
                                            @timkiem.Rows[i]["Name"].ToString()
                                        </a>
                                    </div>
                                    <div class="tintuc_tinkhac_bantin_data_conten">
                                        @*@Html.Raw(timkiem.Rows[i]["Summary"].ToString())*@
                                    </div>
                                </div>
                            </div>
                            }
                        }
                    </div>
                </div>
                <div id="tintuc_phantrang" align="center">
                    <div id="load_page" style="margin-left: 5px">
                    </div>
                </div>
            }
        </div>
    </div>
</div>
<script language="javascript" type="text/javascript">
    $(function () {
        var id = @ViewBag.Id;
        var size = $('#dichvu_mid_left_warpermenu .dichvu_mid_left_menu').size();
        for (var i = 0; i < size; i++) {
            if ($('.dichvu_mid_left_menu').eq(i).attr('index') == id) {
                $('.dichvu_mid_left_menu').eq(i).css({'background-image': 'url(/Images/Css/img/hover_03.png)'});
            } else {
                $('.dichvu_mid_left_menu').eq(i).css({'background-image': 'url(/Images/Css/img/menu-small_06.png)'});
            
            }
        }
        $('.dichvu_mid_left_menu').hover(function() {
                if ($(this).attr('index') != id) {
                    $(this).css({'background-image': 'url(/Images/Css/img/hover_03.png)'});
                }  
            }, function() {
                if ($(this).attr('index') != id) {
                    $(this).css({'background-image': 'url(/Images/Css/img/menu-small_06.png)'});
                } 
            });
    });
</script>
<script type="text/javascript" language="javascript">
                     $(document).ready(function() {
                         pages(@ViewBag.page, @ViewBag.page, @ViewBag.count);
                     });
                     function loadpages(page) {
                         var url = "/TimKiem/TuKhoa/@ViewBag.Model.id?page=" + page;
                         window.location = url;
                     }
</script>
